#ifndef _FLASH_H_
#define _FLASH_H_

#include "sdk_project_config.h"
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>


#define FLASH_INST (0U)

#define DFLASH_BASE     (0x0007D000)
#define DFLASH_SIZE     (12*1024)


#define PFLASH_BASE     	0x00000000
#define PFLASH_SIZE     	(436*1024)

#define MEMORY_APP_START	(0x00010000)




#define PFLASH_BLOCK_SECTOR_SIZE		(1024)

void FLASH_init(void);

status_t DFLASH_Write(uint8_t *dest, uint32_t addrOffset, int32_t size);

status_t DFLASH_Read(uint8_t *read, uint32_t addrOffset, uint32_t size);

status_t PFLASH_Write(uint8_t *dest, uint32_t addrOffset, int32_t size);

status_t PFLASH_Read(uint8_t *read, uint32_t addrOffset, uint32_t size);

status_t DFLASH_DRV_Write(uint32_t dest,
                      uint32_t size,
                      const uint8_t * pData);
#endif
